Conversation
ditto/models/position.py
Outdated
| elevation = Float(help="""Decimal elevation (meters)""") | ||
| # NOTE: We are not really using lat/long I believe, but mostly coordinates in various format | ||
| # TODO: Build the conversion to parse to lat/long from given inputs... | ||
| long = Float(help="""Decimal Longitude""", unit=M) |
There was a problem hiding this comment.
Change long to lng (preferred) or lon. long is a Python builtin.
There was a problem hiding this comment.
Alternatively, you can spell it out fully (latitude, longitude etc).
Codecov Report
@@ Coverage Diff @@
## master #180 +/- ##
==========================================
+ Coverage 43.96% 44.13% +0.16%
==========================================
Files 74 75 +1
Lines 16473 16532 +59
==========================================
+ Hits 7243 7297 +54
- Misses 9230 9235 +5
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
I would strongly reccommend adding units of (decimal/percentage) for the attributes:
- v_max_pu
- v_min_pu
- min_power_factor
- power_factor
- per_unit
- vmin
- vmax
- center_tap_perct_1_N
- center_tap_perct_N_2
- center_tap_perct_1_2
- ppercentcurrent
- qpercentcurrent
- ppercentpower
- qpercentpower
- ppercentimpedance
- qpercentimpdance
- cutout_percent
- cutin_percent
- rise_limit
- fall_limit
- var_injection
- reserve
- discharge_rate
- charging_efficiency
- discharging_efficiency
This ensures that people don't put 100 when DiTTo is expecting 1.0.
Additionally I think that the attribute:
- noload_loss
should not have a unit of None
7c7e60f to
f691839
Compare
|
@tarekelgindy, I rebased this PR and solved the conflicts. |
Codecov Report
@@ Coverage Diff @@
## master #180 +/- ##
==========================================
+ Coverage 43.98% 44.14% +0.16%
==========================================
Files 75 76 +1
Lines 17050 17109 +59
==========================================
+ Hits 7499 7553 +54
- Misses 9551 9556 +5
Continue to review full report at Codecov.
|
| lat = Float(help="""Decimal Latitude""") | ||
| elevation = Float(help="""Decimal elevation (meters)""") | ||
| # NOTE: We are not really using lat/long I believe, but mostly coordinates in various format | ||
| # TODO: Build the conversion to parse to lat/long from given inputs... |
There was a problem hiding this comment.
Re unit lat/long conversion, I've used pyproj in the past and it worked well. The only downside is that if one forgets to set preserve_units=True during initialization things silently break when the input is not in metres.
f691839 to
faef7c9
Compare
8041f05 to
4c1d89d
Compare
4c1d89d to
e3e9c78
Compare
First step to #84
constant.pyfile with the unitsunit=...to all model attributesAs you can see, some attributes are not that obvious. There are a few cases:
Scalar with dimension:
That's the easy case. For example
rated_power==>unit=KVADimensionless scalar:
Convention I used is to define
unit=None. For examplenameorphase...List of dimensionless scalars:
Convention I used is to define
unit=NoneList of scalars with dimension:
Convention I used is to define the unit of the scalars. For example
impedance_matrixis a list ofComplex, andunit=OHM+"/"+MList of DiTTo objects:
Convention I used is to define
unit=None. For examplepositionswhich is a list of position objects. The units of the position attributes are defined inposition.pyAttribute which dimension depends on another attribute's value:
That's the hard case. There are very few of those but I couldn't find a clean solution. For example, in
capacitor.py, thelowandhighattribute's dimension depends on the value ofmode(can be Volts, Watts, amps... depending on the control mode).